In [1]:
%pylab inline


Populating the interactive namespace from numpy and matplotlib

In [2]:
agev = np.array([0.075e9, 0.575e9 ,1.5e9, 2.5e9, 4e9,   6e9,   8.5e9])
dagev = np.array([0.075e9, 0.425e9, 0.5e9, 0.5e9, 1e9,   1e9,   1.5e9])

In [3]:
age = (1e10-agev)/1e9
dage = dagev/1e9

In [4]:
time = age

In [5]:
def sfr(time):
    return(np.exp(-0.12*time))

In [6]:
plt.plot(time,sfr(time))


Out[6]:
[<matplotlib.lines.Line2D at 0x7fea5e62d438>]

In [7]:
sfrv = sfr(time)

In [8]:
sfrv


Out[8]:
array([0.30391719, 0.32271038, 0.36059494, 0.40656966, 0.48675226,
       0.61878339, 0.83527021])

In [9]:
time


Out[9]:
array([9.925, 9.425, 8.5  , 7.5  , 6.   , 4.   , 1.5  ])

In [10]:
dage


Out[10]:
array([0.075, 0.425, 0.5  , 0.5  , 1.   , 1.   , 1.5  ])

In [11]:
sumsfr = dage*sfrv*2
print(sumsfr)


[0.04558758 0.27430383 0.36059494 0.40656966 0.97350451 1.23756678
 2.50581063]

In [12]:
old_sfr = 2.37*7
sum(sumsfr)


Out[12]:
5.803937935843444

In [13]:
old_sfr/(sum(sumsfr))


Out[13]:
2.858404101385191

In [14]:
new_sfr = sumsfr*(old_sfr/sum(sumsfr))

In [15]:
new_sfr


Out[15]:
array([0.13030772, 0.78407118, 1.03072606, 1.16214038, 2.78266929,
       3.53746597, 7.16261939])

In [16]:
agev


Out[16]:
array([7.50e+07, 5.75e+08, 1.50e+09, 2.50e+09, 4.00e+09, 6.00e+09,
       8.50e+09])

This vector assumes that weighting with dage is not happening in Galaxia.


In [17]:
new_sfr = sfrv*(old_sfr/sum(sfrv))

In [18]:
new_sfr


Out[18]:
array([1.5120222 , 1.60552043, 1.79400035, 2.02272975, 2.42164718,
       3.07851692, 4.15556317])

This vector assumes that weighting with dage is done in Galaxia


In [21]:
sum(dage*new_sfr)


Out[21]:
14.437621752542611

In [22]:
2.37*7


Out[22]:
16.59

In [23]:
sum(new_sfr)


Out[23]:
16.59

In [ ]: